package cn.manyufun.myf.ui.main.presenter;


import cn.manyufun.myf.R;
import cn.manyufun.myf.bean.ComicsListBean;
import cn.manyufun.myf.common.baserx.RxSubscriber;
import cn.manyufun.myf.ui.comics.contract.ComicsListContract;

/**
 * des:
 * <p>
 * on 2016.09.17:43
 */
public class ComicsListPresenter extends ComicsListContract.Presenter {
    @Override
    public void getComicsListDataRequest() {
        mRxManage.add(mModel.getComicsListData()
                .subscribe(new RxSubscriber<ComicsListBean>(mContext, false) {
                    @Override
                    public void onStart() {
                        super.onStart();
                        mView.showLoading(mContext.getString(R.string.loading));
                    }

                    @Override
                    protected void _onNext(ComicsListBean newsSummaries) {
                        mView.returnComicsListData(newsSummaries);
                        mView.stopLoading();
                    }

                    @Override
                    protected void _onError(String message) {
                        mView.showErrorTip(message);
                    }
                }));
    }
}
